package cn.qingyun.gis.modules.express.util;

import com.google.common.collect.Lists;

import java.util.List;

public class SqlGenerator {
    public static void main(String[] args) {

        String data = "365124383\t119.199166\t35.731727";

        List<String> updates = Lists.newArrayList();

        for (String row : data.split("\n")) {
            String[] split = row.split("\t");

            updates.add(String.format("update area_community set lon = %s, lat = %s where community_id = %s;", split[1], split[2], split[0]));
            updates.add(String.format("update address_data  set zg_lon = %s, zg_lat = %s, kw_lon  = %s, kw_lat  = %s where zg_xqid = %s;", split[1], split[2], split[1], split[2], split[0]));
            updates.add(String.format("update pf_address_match  set lon = %s, lat = %s where community_id = %s;", split[1], split[2], split[0]));
        }

        System.out.println(String.join("\n", updates));


    }
}
